GtkDialog: Warn about lack of transient parents
authorMatthias Clasen <mclasen@redhat.com>
Fri, 2 May 2014 22:23:58 +0000 (18:23 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 2 May 2014 22:23:58 +0000 (18:23 -0400)
We want make it mandatory for dialogs to have transient parents,
eventually. This is a first step in that direction.

gtk/gtkdialog.c

index 73ae618322272c88a99e965cf94991f63569150c..bf41fb496d1a3ba108ef178afda9b9dd49170e88 100644 (file)
@@ -793,6 +793,9 @@ gtk_dialog_map (GtkWidget *widget)
   GtkWindow *window = GTK_WINDOW (widget);
   GtkDialog *dialog = GTK_DIALOG (widget);
 
+  if (gtk_window_get_transient_for (window) == NULL)
+    g_warning ("GtkDialog mapped without a transient parent. This is discouraged.");
+
   GTK_WIDGET_CLASS (gtk_dialog_parent_class)->map (widget);
 
   focus = gtk_window_get_focus (window);